//
//  EditViewController.swift
//  Swift1
//
//  Created by CrateMac0 on 16/3/19.
//  Copyright © 2016年 Users. All rights reserved.
//

import UIKit

class EditViewController: UIViewController {
    var name:String?
    var age:String?
    var callback:((name: String, age: String)->())?
    @IBOutlet weak var ageLabel: UITextField!
    @IBOutlet weak var nameLabel: UITextField!
    override func viewDidLoad() {
        super.viewDidLoad()
        
        self.ageLabel.text = name
        self.nameLabel.text = age
    }
    
    
    @IBAction func saveField(sender: AnyObject) {
        callback?(name:nameLabel.text!, age:ageLabel.text!)
        navigationController?.popViewControllerAnimated(true)
    }
    deinit {
        print("EditViewController")
    }
}
